<div class="col-md-9">
  <div class="thumbnail"> 
    <!-- breadcrumb -->
    <ol class="breadcrumb breadcrumb-arrow">
      <li><a href="{:U(GROUP_NAME . '/Rbac')}">RBAC</a></li>
      <li><a href="{:U(GROUP_NAME . '/Rbac/role')}">角色列表</a></li>
      <li class="active"><span>配置用户权限</span></li>
    </ol>

    <h3 class="text-center">配置权限</h3>
    <h5 class="text-left"><a href="{:U(GROUP_NAME . '/Rbac/node')}" class="btn btn-info">返　回</a></h5>
    <hr>
    <form action="{:U(GROUP_NAME . '/Rbac/accessHandle')}" method="post">
      <volist name="node" id="app">
        <div id="level1">
          <p>
            <h3>
              <span class="label label-info">{$app.title}</span>
              <input type="checkbox" name="access[]" value="{$app.id}_1" level="1" <if condition="$app['access']"> checked </if> >
            </h3>
          </p>
          <volist name="app.child" id="action">
            <dl>
              <dt>
                <h4>
                  <span class="label label-primary">{$action.title}</span>
                  <input type="checkbox" name="access[]" value="{$action.id}_2" level="2" <if condition="$action['access']"> checked </if>>
                </h4>
              </dt>
              <volist name="action.child" id="method">
                <dd>
                  <h5>
                    <span class="label label-warning">{$method.title}</span>
                    <input type="checkbox" name="access[]" value="{$method.id}_3" level="3" <if condition="$method['access']"> checked </if>>
                  </h5>
                </dd>
              </volist>
            </dl>
          </volist>
        </div>
      </volist>
      <br>
      <input type="hidden" name="rid" value="{$rid}">
      <div class="text-center"> 
        <input type="submit" class="btn btn-primary" value="提交保存">
      </div>
    </form>
  </div>
</div>

<script>
$(document).onload(function(){ 
  $('input[level=1]').click(function () {
    var inputs = $(this).parent('#level').find('input');
    $(this).attr('checked') ? inputs.attr('checked', 'checked') : 
                              inputs.removeAttr('checked');
  });
});
</script>